<template>
  <view>
    <view v-if="f === 'mob'" class="my_cert">
      <view class="h1">
        <view class="span title">{{ ARR.title }}</view>
        <text :class="'span flagstr ' + ARR.class">{{ ARR.class == 'LV' ? '已认证' : '未认证' }}</text>
        <text class="font">{{ ARR.mob }}</text>
      </view>
      <form @submit.stop.prevent="submit_mob_Fn">
        <view class="dl">
          <view class="dt">
            <text class="i ico"></text>
          </view>
          <view class="dd">
            <input
                id="mob"
                :value="value_mob"
                class="input_login"
                maxlength="11"
                name="mob"
                pattern="[0-9]*"
                placeholder="输入其他手机"
                placeholderClass="placeholder"
                type="number"
                @input="value_mobFn"
            />
            <text id="reset_rz" class="span ico"></text>
          </view>
        </view>
        <view class="dl">
          <view class="dt">
            <text class="i ico"></text>
          </view>
          <view class="dd">
            <input
                id="verify"
                :value="value_verify"
                class="input_login"
                maxlength="4"
                name="verify"
                pattern="[0-9]*"
                placeholder="输入短信验证码"
                placeholderClass="placeholder"
                type="number"
            />
            <text v-if="miao == 0" class="yzmbtn" @tap="getyzmFn">重新获取</text>
            <text v-else-if="miao < miao2 && miao > 0" class="yzmbtn">
              请查收手机短信
              <text class="red">{{ miao }}S</text>
            </text>
            <text v-else class="yzmbtn" @tap="getyzmFn">获取验证码</text>
          </view>
        </view>
        <button :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5" formType="submit">提交认证</button>
      </form>
    </view>
    <block v-else-if="f === 'identity'">
      <view v-if="ARR.rzflag == 1" class="my_cert_ed">
        <view class="ico"></view>
        <view class="h1">您已完成《{{ ARR.title }}》</view>
        <view class="rztime_str">{{ ARR.rztime_str }}</view>
      </view>
      <block v-else>
        <view v-if="ARR.rz_mobile3 == 1" class="my_cert mob3box">
          <image :src="WWW + '/res/m/img/rz_bg_xcx.jpg?' + cache_str" class="bg"></image>
          <form class="form" @submit.stop.prevent="submit_mob3_Fn">
            <view class="dl">
              <view class="dt">本人手机</view>
              <view class="dd">
                <input
                    :disabled="true"
                    :value="ARR.mob"
                    autocomplete="off"
                    class="input_login"
                    maxlength="11"
                    name="mob"
                    pattern="[0-9]*"
                    placeholder="本人手机号"
                    placeholderClass="placeholder"
                    type="text"
                />
              </view>
            </view>
            <view class="dl">
              <view class="dt">真实姓名</view>
              <view class="dd">
                <input
                    autocomplete="off"
                    class="input_login"
                    maxlength="20"
                    name="truename"
                    placeholder="请填写您的真实姓名"
                    placeholderClass="placeholder"
                    type="text"
                />
              </view>
            </view>
            <view class="dl">
              <view class="dt">身份证号</view>
              <view class="dd">
                <input
                    autocomplete="off"
                    class="input_login"
                    maxlength="18"
                    name="identitynum"
                    placeholder="请填写您的身份证号"
                    placeholderClass="placeholder"
                    type="text"
                />
              </view>
            </view>
            <view class="dl" style="border: 0; margin-bottom: 0px">
              <view class="dt">认证费用</view>
              <view class="dd">
                <block v-if="ARR.price > 0">
                  ￥
                  <text class="font18">{{ ARR.price }}</text>
                </block>
                <text v-else class="font18lv">免费</text>
              </view>
            </view>
            <view class="price_str">
              <rich-text :nodes="ARR.price_str"></rich-text>
              <block v-if="ARR.sj == 1">
                　
                <text :style="'color:' + color + ';font-weight:bold;'" @tap="vipFn">立即升级</text>
              </block>
            </view>
            <button class="btn5 sm" formType="submit">开始认证</button>
            <view class="linebox">
              <view class="line"></view>
              <view class="title BAI">温馨提醒</view>
            </view>
            <view class="tips">
              <view>● {{ siteName }}作为一个真实、严肃平台，我们要求用户必须完成身份证实名认证，保证用户真实可信</view>
              <view>● 通过认证后，点亮【{{ ARR.title }}】图标，更能获得异性关注，大大提高相亲成功率</view>
              <view>● 通过电信+移动+联通三网联合实名校验，确保信息真实有效</view>
              <view>● 您提交的信息仅用于本站诚信认证服务，不公开，将严格保护您的隐私安全</view>
            </view>
          </form>
        </view>
        <view v-else>
          <form class="form" @submit.stop.prevent="submit_identity_Fn">
            <view class="my_cert">
              <view class="h1">
                <view class="span title">{{ ARR.title }}</view>
                <view :class="'span flagstr ' + (ARR.rzflag == 2 ? '' : 'HUI')">{{
                    ARR.rzflag == 2 ? '审核中' : '未认证'
                  }}
                </view>
              </view>
              <view class="dl">
                <view class="dt"></view>
                <view class="dd">
                  <input
                      :value="ARR.truename"
                      autocomplete="off"
                      class="input_login"
                      maxlength="20"
                      name="truename"
                      placeholder="请填写您的真实姓名"
                      placeholderClass="placeholder"
                      type="text"
                  />
                </view>
              </view>
              <view class="dl">
                <view class="dt"></view>
                <view class="dd">
                  <input
                      :value="ARR.identitynum"
                      autocomplete="off"
                      class="input_login"
                      maxlength="18"
                      name="identitynum"
                      placeholder="请填写您的身份证号"
                      placeholderClass="placeholder"
                      type="text"
                  />
                </view>
              </view>
              <view class="sfzbox">
                <view class="div" @tap="sfz1Fn">
                  <image :src="ARR.sfz1"></image>
                  <view class="span">点击上传国徽面✚</view>
                </view>
                <view class="div" @tap="sfz2Fn">
                  <image :src="ARR.sfz2"></image>
                  <view class="span">点击上传人像面✚</view>
                </view>
              </view>
              <button v-if="ARR.rzflag == 2" class="btn5" style="background-color: #ccc">等待审核..</button>
              <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5" formType="submit">
                提交认证
              </button>
              <view class="linebox">
                <view class="line"></view>
                <view class="title BAI">温馨提醒</view>
              </view>
              <view class="tips">
                <view>●{{ siteName }}作为一个真实、严肃的婚恋平台、我们要求用户必须完成身份证实名认证，保证会员真实</view>
                <view>●您上传的任何身份证图片等资料，仅供审核使用且TA人无法看到，此外，我们会对图片进行安全处理，敬请放心
                </view>
              </view>
            </view>
          </form>
        </view>
      </block>
    </block>
    <block v-else-if="f == 'photo'">
      <view v-if="ARR.rzflag == 1" class="my_cert_ed">
        <view class="ico"></view>
        <view class="h1">您已完成《{{ ARR.title }}》</view>
        <view class="rztime_str">{{ ARR.rztime_str }}</view>
      </view>
      <view v-else class="my_cert mob3box photobox">
        <image :src="WWW + '/res/m/img/rz_bg2_xcx.jpg?' + cache_str" class="bg"></image>
        <form class="form" @submit.stop.prevent="submit_photo_Fn">
          <view class="dl">
            <view class="dt">真实姓名</view>
            <view class="dd">
              <input
                  autocomplete="off"
                  class="input_login"
                  maxlength="20"
                  name="truename"
                  placeholder="请填写您的真实姓名"
                  placeholderClass="placeholder"
                  type="text"
              />
            </view>
          </view>
          <view class="dl">
            <view class="dt">身份证号</view>
            <view class="dd">
              <input
                  autocomplete="off"
                  class="input_login"
                  maxlength="18"
                  name="identitynum"
                  placeholder="请填写您的身份证号"
                  placeholderClass="placeholder"
                  type="text"
              />
            </view>
          </view>
          <view class="dl" style="border: 0; margin-bottom: 0px">
            <view class="dt">认证费用</view>
            <view class="dd">
              <block v-if="ARR.price > 0">
                ￥
                <text class="font18">{{ ARR.price }}</text>
              </block>
              <text v-else class="font18lv">免费</text>
            </view>
          </view>
          <view class="price_str">
            <rich-text :nodes="ARR.price_str"></rich-text>
            <block v-if="ARR.sj == 1">
              　
              <text :style="'color:' + color + ';font-weight:bold;'" @tap="vipFn">立即升级</text>
            </block>
          </view>
          <button class="btn5 rl" formType="submit">请正对手机，开始认证</button>
          <view class="linebox">
            <view class="line"></view>
            <view class="title BAI">温馨提醒</view>
          </view>
          <view class="tips">
            <view>● {{ siteName }}作为一个真实、严肃平台、我们要求用户必须完成身份证实名认证，保证用户真实可信</view>
            <view>● 通过认证后，点亮【{{ ARR.title }}】图标，更能获得异性关注，大大提高相亲成功率</view>
            <view>● 通过人脸活体与公安库进行校验，确保信息真实有效</view>
            <view>● 认证后的照片、身份证、姓名不公开，严格保护您的隐私安全</view>
          </view>
        </form>
      </view>
    </block>
    <block v-else-if="f == 'store'">
      <view v-if="ARR.rzflag == 1" class="my_cert_ed">
        <view class="ico"></view>
        <view class="h1">您已完成《{{ ARR.title }}》</view>
        <view class="rztime_str">{{ ARR.rztime_str }}</view>
      </view>
      <view v-else class="my_cert">
        <view class="h1">
          <view class="span title">{{ ARR.title }}</view>
          <text :class="'span flagstr ' + ARR.class">{{ ARR.class == 'LV' ? '已认证' : '未认证' }}</text>
        </view>
        <view class="my_cert_store">
          <view :style="'background-image:-webkit-linear-gradient(left,rgba(' + rgbcolor + ',.7),' + color + ');'"
                class="i ico big">
          </view>
          <view class="h5">
            <view>需要您本人亲自到店</view>
            <view>与经纪人面谈沟通，工作人员人工帮您点亮，或扫码预约客服，安排经纪人上门与您面谈。</view>
            <view class="b">店面地址：{{ kf_address }}</view>
          </view>
          <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5 ico" @tap="kefuFn"> 点击预约到店
          </view>
        </view>
      </view>
    </block>
    <block v-else-if="f == 'weixin'">
      <view v-if="ARR.rzflag == 1" class="my_cert_ed">
        <view class="ico"></view>
        <view class="h1">您已完成《{{ ARR.title }}》</view>
        <view class="rztime_str">{{ ARR.rztime_str }}</view>
      </view>
      <block v-else>
        <view class="my_cert">
          <view class="h1">
            <view class="span title">{{ ARR.title }}</view>
            <text :class="'span flagstr ' + ARR.class">{{ ARR.class == 'LV' ? '已认证' : '未认证' }}</text>
          </view>
          <form @submit.stop.prevent="submit_weixin_Fn">
            <view class="dl">
              <view class="dt">
                <text class="i ico"></text>
              </view>
              <view class="dd">
                <input
                    :value="ARR.weixin"
                    autocomplete="off"
                    class="input_login"
                    maxlength="50"
                    name="weixin"
                    placeholder="请填写您的微信号"
                    placeholderClass="placeholder"
                />
              </view>
            </view>
            <button v-if="ARR.rzflag == 2" class="btn5 btn5else" style="background-color: #ccc">等待审核..</button>
            <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5 btn5else"
                    formType="submit">提交认证
            </button>
          </form>
          <view class="linebox">
            <view class="line"></view>
            <view class="title BAI">温馨提醒</view>
          </view>
          <view class="tips">
            <view>{{ ARR.title }}成功后，点亮{{ ARR.title }}图标</view>
          </view>
        </view>
        <view v-if="kefu_weixin" class="mask3 alpha0_100">
          <view class="div_box big_normal wxrz" style="--div_box_width: 80%; --div_box_height: 860rpx">
            <view class="close ico" @tap="kefu_weixin_closeFn"></view>
            <view class="kf_wxpic">
              <image :showMenuByLongpress="true" :src="kfARR.kf_wxpic"></image>
            </view>
            <view class="kf_text t1">扫二维码添加客服验证</view>
            <view class="kf_text t2">
              请用当前微信号
              <text>{{ kfARR.weixin }}</text>
              添加客服微信
              <text>{{ kfARR.kf_wx }}</text>
              或扫码上方二维码
            </view>
            <view class="kf_text t2">
              在发送添加朋友申请里填写
              <view>
                <text>ID：{{ kfARR.cook_uid }} 微信认证</text>
                内容字样
              </view>
            </view>
            <view :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn44" @tap="kefu_weixin_closeFn">
              朕知道了
            </view>
          </view>
        </view>
      </block>
    </block>
    <block
        v-else-if="f == 'edu' || f == 'car' || f == 'house' || f == 'love' || f == 'pay' || f == 'job' || f === 'credit' || f === 'health'  ">
      <view v-if="ARR.rzflag == 1" class="my_cert_ed">
        <view class="ico"></view>
        <view class="h1">您已完成《{{ ARR.title }}》</view>
        <view class="rztime_str">{{ ARR.rztime_str }}</view>
      </view>
      <view v-else class="my_cert">
        <view class="h1">
          <view class="span title">{{ ARR.title }}</view>
          <text :class="'span flagstr ' + ARR.class">{{ ARR.class == 'LV' ? '已认证' : '未认证' }}</text>
        </view>
        <view class="certbox">
          <image :src="ARR.path_b" mode="aspectFit" @tap="elseupFn"></image>
          <view class="span" @tap="elseupFn">
            点击拍照上传{{ ARR.tips }}
            <text class="i ico"></text>
          </view>
        </view>
        <button v-if="ARR.rzflag == 2" class="btn5 btn5else" style="background-color: #ccc">等待审核..</button>
        <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor" class="btn5 btn5else"
                formType="button" @tap="elsebtnFn">提交认证
        </button>
        <view class="linebox">
          <view class="line"></view>
          <view class="title BAI">温馨提醒</view>
        </view>
        <view class="tips">
          <view>● 请拍照上传清晰的{{ ARR.tips }}，如上图示例</view>
          <view>● {{ ARR.title }}成功后，点亮{{ ARR.title }}图标</view>
          <view>● 您上传的任何身份证图片等资料，仅供审核使用且TA人无法看到，此外，我们会对图片进行安全处理，敬请放心</view>
        </view>
      </view>
    </block>
    <block v-else-if="f == 'alert'"></block>
    <view v-else class="index">
      <view v-for="(item, index) in RZindex" :key="index" :class="'li2 ' + item.class" :data-f="item.f"
            @tap="certoneFn">
        <view v-if="item.f === 'health' ||item.f === 'credit' ">
          <view v-if="item.class == 'ed'"
                :class="['i','alyIcon-rzico_' + item.f,]"
                :style="'background-image:-webkit-linear-gradient(left,' + item.bg + ');'">
            <text class="ico span"></text>
          </view>

          <view v-else :class="['i','alyIcon-rzico_' + item.f,]">
            <text class="ico span"></text>
          </view>

          <view class="h4">{{ item.title }}</view>

          <view v-if="item.flagstr != ''" class="h5">审核中</view>
        </view>
        <view v-else>
            <view v-if="item.class == 'ed'"
                  :class="'i ico rzico_' + item.f"
                  :style="'background-image:-webkit-linear-gradient(left,' + item.bg + ');'">
              <text class="ico span"></text>
            </view>

            <view v-else :class="'i ico rzico_' + item.f">
              <text class="ico span"></text>
            </view>

            <view class="h4">{{ item.title }}</view>

            <view v-if="item.flagstr != ''" class="h5">审核中</view>
        </view>
      </view>
    </view>
    <view v-if="kefu" class="mask3 alpha0_100">
      <view class="div_box big_normal" style="--div_box_width: 70%; --div_box_height: 666rpx">
        <view class="close ico" @tap="kefu_closeFn"></view>
        <view class="kf_wxpic">
          <image :showMenuByLongpress="true" :src="kf_wxpic"></image>
        </view>
        <view class="kf_text">长按二维码添加客服微信</view>
        <view class="kf_text">咨询经纪人1对1人工服务</view>
      </view>
    </view>
  </view>
</template>

<script>
var t;
var e = require('../../@babel/runtime/helpers/defineProperty');
var a = require('../../res/www.a9a.cn.js');
var app = getApp();
export default {
  data() {
    return {
      miao: 120,
      miao2: 120,
      f: '',
      RZindex: [],
      ss: '',
      tmpsfz: ['', ''],
      elsetmp: '',
      showModalC:
          '请填写征婚者本人手机号码、本人姓名、身份证号、本人头像，经公安库身份自动核对通过的才是真实资料\n\n如有第三方公安库收取核验费用的，无法通过的均为虚假资料，不予退款\n\n冒用TA人信息注册或转让自己征婚信息帐号的均属违法行为，承担相应法律责任，请你真诚征婚交友，违法必究',
      ifonLoad: false,
      color: '',
      rgbcolor: '',
      siteName: '',
      WWW: '',
      cache_str: '',
      MB: '',

      ARR: {
        title: '',
        class: '',
        mob: '',
        rzflag: 0,
        rztime_str: '',
        rz_mobile3: 0,
        price: 0,
        price_str: '',
        sj: 0,
        truename: '',
        identitynum: '',
        sfz1: '',
        sfz2: '',
        weixin: '',
        path_b: '',
        tips: ''
      },

      kf_wxpic: '',
      kf_address: '',
      value_mob: '',
      value_verify: '',
      kefu_weixin: false,

      kfARR: {
        kf_wxpic: '',
        weixin: '',
        kf_wx: '',
        cook_uid: ''
      },

      kefu: false
    };
  },
  onLoad: function (t) {
    var that = this;
    var i = this;
    app.globalData.chklogin().then(function (n) {
      if (n) {
        app.globalData.get_config('_ZEAI').then(function (t) {
          i.setData({
            color: t.color,
            rgbcolor: a.c16_rgb(t.color),
            siteName: t.siteName,
            WWW: app.globalData.WWW,
            cache_str: t.cache_str
          });
        });
        app.globalData.get_openid().then(function (a) {
          var n = t.f;
          i.setData({
            f: n
          });
          if (app.globalData.empty(n)) {
            i.setData({
              ifonLoad: true
            });
            that.index();
          } else {
            i.one(n);
          }
        });
      } else {
        uni.redirectTo({
          url: '/pages/login/login'
        });
      }
    });
  },
  onShow: function () {
    if (2 == getCurrentPages().length && this.ifonLoad) {
      this.index();
    }
  },
  onShareAppMessage: function () {
    return {
      imageUrl: '',
      title: '诚信认证',
      path: '/pages/cert/cert'
    };
  },
  methods: {
    index: function () {
      var that = this;
      t = uni.getStorageSync('COOK_U');
      app.globalData.ajax({
        url: 'my_cert.php',
        data: {
          submitok: 'index',
          openid: t.openid
        },
        success: function (t) {
          if (1 == t.flag) {
            that.setData({
              RZindex: t.RZindex,
              MB: t.MB
            });
          } else {
            uni.showModal({
              content: t.msg,
              confirmColor: that.color,
              confirmText: '朕知道了',
              showCancel: false,
              success: function (t) {
                uni.navigateBack();
              }
            });
          }
          uni.setNavigationBarTitle({
            title: '诚信认证'
          });
        }
      });
    },

    certoneFn: function (t) {
      var e = t.currentTarget.dataset.f;
      a.empty(this.MB) || app.globalData.openSetting(this.MB);
      uni.navigateTo({
        url: 'cert?f=' + e
      });
    },

    one: function (e) {
      uni.showLoading({
        title: '玩命加载中',
        mask: true
      });
      var that = this;
      t = uni.getStorageSync('COOK_U');
      app.globalData.ajax({
        url: 'my_cert.php',
        data: {
          submitok: 'one',
          f: e,
          openid: t.openid
        },
        success: function (t) {
          1 == t.flag
              ? (that.setData({
                ARR: t.ARR,
                kf_wxpic: t.kf_wxpic,
                kf_address: t.kf_address
              }),
                  uni.setNavigationBarTitle({
                    title: t.ARR.title
                  }),
                  'identity' == e && 1 == t.ARR.rz_mobile3
                      ? uni.setNavigationBarColor({
                        backgroundColor: '#083BB1',
                        frontColor: '#ffffff'
                      })
                      : 'photo' == e &&
                      1 != that.ARR.rzflag &&
                      uni.setNavigationBarColor({
                        backgroundColor: '#0A183F',
                        frontColor: '#ffffff'
                      }),
                  that.setData({
                    ifonLoad: true
                  }))
              : (that.setData({
                f: 'alert'
              }),
                  uni.showModal({
                    content: t.msg,
                    confirmColor: that.color,
                    confirmText: '朕知道了',
                    showCancel: false,
                    success: function (t) {
                      uni.navigateBack();
                    }
                  }));
          uni.hideLoading();
        }
      });
    },

    vipFn: function () {
      uni.navigateTo({
        url: '/pagesA/my_vip/my_vip'
      });
    },

    value_mobFn: function (t) {
      this.setData({
        value_mob: t.detail.value
      });
    },

    getyzmFn: function (e) {
      var i = this.value_mob;
      if (a.ifmob(i)) {
        var that = this;
        t = uni.getStorageSync('COOK_U');
        app.globalData.ajax({
          url: 'my_cert.php',
          data: {
            submitok: 'ajax_get_verify',
            mob: i,
            openid: t.openid
          },
          success: function (t) {
            1 == t.flag
                ? (uni.showToast({
                  title: t.msg,
                  icon: 'none',
                  mask: true
                }),
                    that.setData({
                      ss: t.ss,
                      value_verify: '',
                      miao: that.miao2 - 1
                    }),
                    (that.time = setInterval(function () {
                      that.setData({
                        miao: that.miao - 1
                      });
                      if (0 == that.miao) {
                        clearInterval(that.time);
                      }
                    }, 1000)))
                : uni.showModal({
                  content: t.msg,
                  confirmColor: that.color,
                  confirmText: '朕知道了',
                  showCancel: false,
                  success: function (t) {
                  }
                });
          }
        });
      } else {
        uni.showToast({
          title: '请输入正确的【手机号码】',
          icon: 'none',
          mask: true
        });
      }
    },

    submit_weixin_Fn: function (e) {
      var that = this;
      var i = e.detail.value.weixin;
      app.globalData.ifweixin(i)
          ? ((t = uni.getStorageSync('COOK_U')),
              app.globalData.ajax({
                url: 'my_cert.php',
                data: {
                  submitok: 'weixin_update',
                  weixin: i,
                  openid: t.openid
                },
                success: function (t) {
                  1 == t.flag
                      ? that.setData({
                        kefu_weixin: true,
                        kfARR: t.kfARR
                      })
                      : uni.showModal({
                        content: t.msg,
                        confirmColor: that.color,
                        confirmText: '朕知道了',
                        showCancel: false,
                        success: function (t) {
                        }
                      });
                }
              }))
          : uni.showToast({
            title: '请输入正确的【微信号】',
            icon: 'none',
            mask: true
          });
    },

    kefu_weixin_closeFn: function () {
      this.setData({
        kefu_weixin: false
      });
      uni.navigateBack();
    },

    submit_mob_Fn: function (e) {
      var that = this;
      var n = e.detail.value.mob;
      var s = e.detail.value.verify;
      a.ifmob(n)
          ? a.ifint(s)
              ? ((t = uni.getStorageSync('COOK_U')),
                  app.globalData.ajax({
                    url: 'my_cert.php',
                    data: {
                      submitok: 'ajax_cert_mob_addupdate',
                      mob: n,
                      ss: that.ss,
                      verify: s,
                      openid: t.openid
                    },
                    success: function (t) {
                      1 == t.flag
                          ? (uni.showToast({
                            title: t.msg,
                            mask: true,
                            duration: 3000
                          }),
                              setTimeout(function () {
                                uni.navigateBack();
                              }, 3000))
                          : uni.showModal({
                            content: t.msg,
                            confirmColor: that.color,
                            confirmText: '朕知道了',
                            showCancel: false,
                            success: function (t) {
                            }
                          });
                    }
                  }))
              : uni.showToast({
                title: '请输入正确的【短信验证码】',
                icon: 'none',
                mask: true
              })
          : uni.showToast({
            title: '请输入正确的【手机号码】',
            icon: 'none',
            mask: true
          });
    },

    submit_mob3_Fn: function (e) {
      var i = e.detail.value.mob;
      var n = e.detail.value.truename;
      var s = e.detail.value.identitynum;
      var that = this;
      a.ifmob(i)
          ? a.empty(n)
              ? uni.showToast({
                title: '请输入【真实姓名】',
                icon: 'none',
                mask: true
              })
              : a.ifsfz(s)
                  ? uni.showModal({
                    title: '温馨提醒',
                    content: that.showModalC,
                    confirmColor: that.color,
                    cancelText: '取消',
                    confirmText: '确定提交',
                    success: function (e) {
                      if (e.confirm) {
                        var a = parseFloat(that.ARR.price);
                        var l = {
                          submitok: 'identity_mob3_update',
                          mob: i,
                          truename: n,
                          identitynum: s,
                          openid: t.openid
                        };
                        a > 0
                            ? app.globalData.pay({
                              data: {
                                submitok: 'my_cert',
                                f: 'identity'
                              },
                              success: function () {
                                that.submit_mob3_Fn_public(l);
                              },
                              fail: function () {
                                console.log('支付失败');
                              }
                            })
                            : that.submit_mob3_Fn_public(l);
                      }
                    }
                  })
                  : uni.showToast({
                    title: '请输入正确的【身份证号码】',
                    icon: 'none',
                    mask: true
                  })
          : uni.showToast({
            title: '请输入正确的【手机号码】',
            icon: 'none',
            mask: true
          });
    },

    submit_mob3_Fn_public: function (t) {
      var that = this;
      app.globalData.ajax({
        url: 'my_cert.php',
        data: t,
        success: function (t) {
          1 == t.flag
              ? (uni.showToast({
                title: t.msg,
                mask: true,
                duration: 3000
              }),
                  setTimeout(function () {
                    uni.navigateBack();
                  }, 3000))
              : uni.showModal({
                title: t.title,
                content: t.msg,
                confirmColor: that.color,
                confirmText: '朕知道了',
                showCancel: false,
                success: function (t) {
                  uni.navigateBack();
                }
              });
        }
      });
    },

    sfz1Fn: function () {
      if (0 == this.ARR.rzflag) {
        var that = this;
        uni.chooseMedia({
          count: 1,
          mediaType: ['image'],
          sourceType: ['album', 'camera'],
          sizeType: ['compressed'],
          success: function (a) {
            var o;
            that.setData((e((o = {}), 'ARR.sfz1', a.tempFiles[0].tempFilePath), e(o, 'tmpsfz[0]', a.tempFiles[0].tempFilePath), o));
          }
        });
      } else {
        uni.showToast({
          title: '请等待审核',
          icon: 'none',
          mask: true
        });
      }
    },

    sfz2Fn: function () {
      if (0 == this.ARR.rzflag) {
        var that = this;
        uni.chooseMedia({
          count: 1,
          mediaType: ['image'],
          sourceType: ['album', 'camera'],
          sizeType: ['compressed'],
          success: function (a) {
            var o;
            that.setData((e((o = {}), 'ARR.sfz2', a.tempFiles[0].tempFilePath), e(o, 'tmpsfz[1]', a.tempFiles[0].tempFilePath), o));
          }
        });
      } else {
        uni.showToast({
          title: '请等待审核',
          icon: 'none',
          mask: true
        });
      }
    },

    submit_identity_Fn: function (e) {
      var i = e.detail.value.truename;
      var n = e.detail.value.identitynum;
      var that = this;
      if (a.empty(i))
        uni.showToast({
          title: '请输入【真实姓名】',
          icon: 'none',
          mask: true
        });
      else if (a.ifsfz(n)) {
        if (a.empty(this.tmpsfz[0]) || a.empty(this.tmpsfz[1])) {
          uni.showToast({
            title: '请上传【身份证照片】',
            icon: 'none',
            mask: true
          });
        } else {
          var c = {
            submitok: 'identity_update',
            truename: i,
            identitynum: n,
            openid: t.openid
          };
          uni.uploadFile({
            url: app.globalData.WWW + '/api/wxxcx/my_cert.php',
            filePath: that.tmpsfz[0],
            name: 'pic0',
            formData: c,
            success: function (t) {
              1 == (t = a.jsoneval(t.data)).flag
                  ? uni.uploadFile({
                    url: app.globalData.WWW + '/api/wxxcx/my_cert.php',
                    filePath: that.tmpsfz[1],
                    name: 'pic1',
                    formData: c,
                    success: function (t) {
                      1 == (t = a.jsoneval(t.data)).flag
                          ? (uni.showToast({
                            title: t.msg,
                            mask: true,
                            duration: 3000
                          }),
                              setTimeout(function () {
                                uni.navigateBack();
                              }, 3000))
                          : uni.showModal({
                            content: t.msg,
                            confirmColor: that.color,
                            confirmText: '朕知道了',
                            showCancel: false,
                            success: function (t) {
                            }
                          });
                    }
                  })
                  : uni.showModal({
                    content: t.msg,
                    confirmColor: that.color,
                    confirmText: '朕知道了',
                    showCancel: false,
                    success: function (t) {
                    }
                  });
            }
          });
        }
      } else {
        uni.showToast({
          title: '请输入正确的【身份证号码】',
          icon: 'none',
          mask: true
        });
      }
    },

    submit_photo_Fn: function (t) {
      var e = t.detail.value.truename;
      var i = t.detail.value.identitynum;
      var that = this;
      a.empty(e)
          ? uni.showToast({
            title: '请输入【真实姓名】',
            icon: 'none',
            mask: true
          })
          : a.ifsfz(i)
              ? uni.showModal({
                title: '温馨提醒',
                content: '请【平视镜头】保持【光线明亮】\n\n请勿戴帽子，摇头等动作幅度不能大\n\n动作缓慢，否则会检测不到人脸失败',
                confirmColor: that.color,
                cancelText: '取消',
                confirmText: '开始核验',
                success: function (t) {
                  if (t.confirm) {
                    parseFloat(that.ARR.price) > 0
                        ? app.globalData.pay({
                          data: {
                            submitok: 'my_cert',
                            f: 'photo'
                          },
                          success: function () {
                            uni.navigateTo({
                              url: '/myPages/cert_face/cert_face?truename=' + e + '&identitynum=' + i
                            });
                          },
                          fail: function () {
                            console.log('支付失败');
                          }
                        })
                        : uni.navigateTo({
                          url: '/myPages/cert_face/cert_face?truename=' + e + '&identitynum=' + i
                        });
                  }
                }
              })
              : uni.showToast({
                title: '请输入正确的【身份证号码】',
                icon: 'none',
                mask: true
              });
    },

    kefuFn: function () {
      this.setData({
        kefu: true
      });
    },

    kefu_closeFn: function () {
      this.setData({
        kefu: false
      });
    },

    elseupFn: function () {
      var that = this;
      0 == this.ARR.rzflag
          ? (that.setData({
            ifonLoad: false
          }),
              uni.chooseMedia({
                count: 1,
                mediaType: ['image'],
                sourceType: ['album', 'camera'],
                sizeType: ['compressed'],
                success: function (a) {
                  var o;
                  that.setData((e((o = {}), 'ARR.path_b', a.tempFiles[0].tempFilePath), e(o, 'elsetmp', a.tempFiles[0].tempFilePath), o));
                }
              }))
          : uni.showToast({
            title: '请等待审核',
            icon: 'none',
            mask: true
          });
    },

    elsebtnFn: function () {
      var that = this;
      if (a.empty(that.elsetmp)) {
        uni.showToast({
          title: '请上传认证照片',
          icon: 'none',
          mask: true
        });
      } else {
        var i = {
          submitok: 'else_update',
          f: that.f,
          openid: t.openid
        };
        uni.uploadFile({
          url: app.globalData.WWW + '/api/wxxcx/my_cert.php',
          filePath: that.ARR.path_b,
          name: 'pic',
          formData: i,
          success: function (t) {
            1 == (t = a.jsoneval(t.data)).flag
                ? (uni.showToast({
                  title: t.msg,
                  mask: true,
                  duration: 3000
                }),
                    setTimeout(function () {
                      uni.navigateBack();
                    }, 3000))
                : uni.showModal({
                  content: t.msg,
                  confirmColor: that.color,
                  confirmText: '朕知道了',
                  showCancel: false,
                  success: function (t) {
                    uni.navigateBack();
                  }
                });
          }
        });
      }
    }
  }
};
</script>
<style>
@import 'cert.css';
</style>
